package org.example.cet.demos.service.impl;

import org.example.cet.demos.domain.PageBean;
import org.example.cet.demos.mapper.UserLoginMapper;
import org.example.cet.demos.mapper.UserMapper;
import org.example.cet.demos.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.example.cet.demos.domain.po.User;

import java.util.List;
@Service
public class UserLoginServiceImpl implements UserService {
    @Autowired
    private UserLoginMapper userMapper;
    @Override
    public User login(User user) {
        String username = user.getUsername();
        String password = user.getPassword();
        return userMapper.getByUsernameAndPassword(username, password);
    }

//    @Override
//    public PageBean findMyInf(Integer page, Integer pageSize, String username) {
//        Long count = userMapper.count();
//
//        Integer start = (page - 1) * pageSize;
//        List<User> userList = userMapper.findMyInf(start, pageSize, username);
//
//        PageBean pageBean = new PageBean(count, userList);
//        return pageBean;
//    }
}
